<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新增礼包信息</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
	src="${pageContext.request.contextPath }/js/common/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>

	<form action="http://127.0.0.1:8081/bsc/jhy/updateBis_nurse_bag" id="fo"
		name="fo" method="post" class="form-inline"
		enctype="multipart/form-data"  >
		<table border="0" cellspacing="0" cellpadding="10" width="80%"
			class="table ">
			<h2 align="center">修改礼包信息</h2>
			<input type="hidden" name="bag_id" value="${bnb.bag_id }"/>
			<tr>
				<td width="15%" align="right">礼包名称:</td>
				<td width="35%"><input type="text" id="bag_name"
					name="bag_name" value="${bnb.bag_name }" class="form-control" /></td>
				<td width="15%" align="right">状态:</td>
				<td width="35%">
				<input id="statusval" type="hidden" class="span2"  value="${bnb.status}" >
				<select name="status" id="status"
					class="form-control">
						<option value="1">在售</option>
						<option value="2">下架</option>
				</select></td>
			</tr>
			<tr>
				<td align="right">列表图片:</td>
				<td><input type="file" class="form-control" name="file1" value="http://localhost:8081/bsc/js/${bnb.cover_big_photo}">
					<div style="width:100px; height:100px; border-radius:50%; overflow:hidden;">
				<img width="100px" height="100px" src="http://localhost:8081/bsc/js/${bnb.cover_big_photo}" >
				</div></td>
				<td align="right">封面图片:</td>
				<td><input type="file" class="form-control"
					 name="file2" value="http://localhost:8081/bsc/js/${bnb.cover_photo}">
					 <div style="width:100px; height:100px; border-radius:50%; overflow:hidden;">
				<img width="100px" height="100px" src="http://localhost:8081/bsc/js/${bnb.cover_photo}"></td>
				</div></td>
			</tr>
			<tr>
				<td align="right">礼包价格:</td>
				<td><input type="text" id="bag_total_price" name="bag_total_price" class="form-control" value="${bnb.bag_total_price }">元</td>
				<td align="right">开卡数量:</td>
				<td><input type="text" id="open_card_num" name="open_card_num" class="form-control" value="${bnb.open_card_num }"></td>
			</tr>
			<tr>
				<td align="right">每次最少购买量:</td>
				<td><input type="text" id="max_buy_num" name="max_buy_num" class="form-control" value="${bnb.max_buy_num }">个</td>
				<td align="right">每次最大购买量:</td>
				<td><input type="text" id="min_buy_num" name="min_buy_num" class="form-control" value="${bnb.min_buy_num }">元</td>
			</tr>
			<tr>
				<td align="right">允许购买次数:</td>
				<td><input type="text" id="buy_count" name="buy_count" class="form-control" value="${bnb.buy_count }"></td>
				<td align="right">过期时间:</td>
				<td><input type="text" id="overdue_time" name="overdue_time" class="form-control" value="${bnb.overdue_time }">天</td>
			</tr>
			<tr>
				<td align="right">上架时间:</td>
				<td><input type="date" id="putaway_time" name="putaway_time" class="form-control" value="${bnb.putaway_time }"></td>
				<td align="right">下架时间:</td>
				<td><input type="date" id="soldout_time" name="soldout_time" class="form-control" value="${bnb.soldout_time }"></td>
			</tr>
			<tr>
				<td align="right">排序号:</td>
				<td><input type="text" id="sort_no" name="sort_no" class="form-control" value="${bnb.sort_no }"></td>
				<td align="right">礼包介绍:</td>
				<td><input type="text" id="bag_introduce" name="bag_introduce" class="form-control" value="${bnb.bag_introduce }"></td>
			</tr>
			<tr>
				<td align="right">购买说明</td>
				<td colspan="3"><textarea class="form-control" rows="10"
						cols="100" name="content" id="content">${bnb.content }</textarea>

					<button class="btn btn-default" type="submit">
						<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>
						保存
					</button></td>
			</tr>

		</table>
	</form>

</body>
</html>
<script type="text/javascript">
$(document).ready(function(){ 
    var Flag=$("#statusval").val();
    //alert(Flag);
    //根据值让option选中 
    if(Flag=="1"){
        $("#status option[value='"+Flag+"']").attr("selected","selected");
    }else if(Flag=="2"){
        $("#status option[value='"+Flag+"']").attr("selected","selected");
    }
}); 
</script>
<!-- <c:forEach items="${bnp }" var="bnp">
					<tr>
						<td>${bnp.project_name }</td>
						<td><input type="text" id="" value="${ }"></td>
						<td><input type="text" id="" value=""></td>
						<td><a class="btn btn-danger btn-xs"
						href="delBag/${bag.bag_id }" role="button"> <span
							class="glyphicon glyphicon-trash" aria-hidden="true"></span> 删除
					</a>
					<a class="btn btn-warning btn-xs" href="selectBagById/${bag.bag_id }"
						 role="button" id="selectBagById">详情</a></td></tr>
					</c:forEach> -->